<%--
  Created by IntelliJ IDEA.
  User: zjsxx
  Date: 2018/2/4
  Time: 21:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/index_v3.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:18:46 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>H+ 后台主题UI框架 - 首页示例二</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <!-- Morris -->
    <link href="/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">

    <!-- Gritter -->
    <link href="/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">

    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div id="showPalce"></div>


    </div>

</div>

<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/flot/jquery.flot.js"></script>
<script src="/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="/js/plugins/flot/jquery.flot.spline.js"></script>
<script src="/js/plugins/flot/jquery.flot.resize.js"></script>
<script src="/js/plugins/flot/jquery.flot.pie.js"></script>
<script src="/js/plugins/flot/jquery.flot.symbol.js"></script>
<script src="/js/plugins/peity/jquery.peity.min.js"></script>
<script src="/js/demo/peity-demo.min.js"></script>
<script src="/js/content.min.js?v=1.0.0"></script>
<script src="/js/plugins/jquery-ui/jquery-ui.min.js"></script>
<script src="/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="/js/plugins/easypiechart/jquery.easypiechart.js"></script>
<script src="/js/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="/js/demo/sparkline-demo.min.js"></script>


<script>
    function setData(name, date, state, personal, url) {
        var person = (personal == 1) ? "公开" : "私人";
        var nowState = (state == 1) ? "正常" : "暂停运行";
        var data = "<div class=\"col-sm-6\">\n" +
            "            <div class=\"ibox float-e-margins\">\n" +
            "                <div class=\"ibox-title\">\n" +
            "                    <span class=\"label label-success pull-right\">" + person + "</span>\n" +
            "                    <h5> 智能设备" + "</h5>\n" +
            "                </div>\n" +
            "                <div class=\"ibox-content\">\n" +
            "                    <h1 class=\"no-margins\">" + "<a href=" + url + ">" + name + "</a>" + "</h1>\n" +
            "                    <div class=\"stat-percent font-bold text-success\">" + nowState + " <i class=\"fa fa-bolt\"></i>\n" +
            "                    </div>\n" +
            "                    <small>创建日期：" + date + "</small>\n" +
            "                </div>\n" +
            "            </div>\n" +
            "        </div>";
        return data;
    }

    $(document).ready(function () {
        var key = null;
        var v = document.cookie.split(";");
        for (var i = 0; i < v.length; i++) {
            var item = v[i].split("=");
            if (item[0] == 'easylink_user_token') {
                key = item[1];
                break;
            }
        }
        $.ajax({
            type: 'GET',
            url: '/device/searchUserAllDevice',
            headers: {
                'easylink_user_token': key
            },
            success: function (message) {
                var ret = message.data;
                for (var i = 0; i < ret.length; i++) {

                    var info = ret[i];
                    //由于url里面#是有特殊意义的 所以把它换成了_
                    var reg = /#/g;
                    var tag = info.deviceTag;
                    if (tag != null) {
                        tag = tag.replace(reg, '_');
                    }
                    //构建url
                    var url = '/userManager/deviceInfo/?'
                        + 'deviceId=' + info.deviceId + '&'
                        + 'deviceDesc=' + info.deviceDesc + '&'
                        + 'deviceLongitude=' + info.deviceLongitude + '&'
                        + 'deviceLatitude=' + info.deviceLatitude + '&'
                        + 'userId=' + info.userId + '&'
                        + 'deviceState=' + info.deviceState + '&'
                        + 'deviceTag=' + tag + '&'
                        + 'devicePersonal=' + info.devicePersonal + '&'
                        + 'deviceName=' + info.deviceName + '&'
                        + 'deviceCreateTime=' + info.deviceCreateTime + '&'
                        + 'deviceUpdateTime=' + info.deviceUpdateTime;
                    url = encodeURI(url);
                    var data = setData(info.deviceName, info.deviceCreateTime, info.deviceState, info.devicePersonal, url);

                    $('#showPalce').append(data);
                }

            },
            error: function (message) {
                console.log(message);
            }
        });


    });
</script>

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>


</html>

